#ifndef UDP_CONNECTOR_H
#define UDP_CONNECTOR_H
#include "io_connector.h"
#ifdef _USING_ACE
#include "./detail/ace_udp_connector_impl.h"
#else 
#include "./detail/asio_udp_connector_impl.h"
#endif //

//udp connector should behave like a udp acceptor. 
//but this model should be useful for extend the connected udp diagram. 

namespace vpm
{
	namespace mina
	{
		class UdpConnector : public IoConnector
		{
		public:


			UdpConnector(UdpConnectorConfig& config ,IoHandler& handler):m_udpConnector(config,handler)
			{

			}

			virtual int connect( const ServiceUrl &localUrl = ServiceUrl(""))
			{
				return m_udpConnector.connect(localUrl.port,localUrl.host);
			}

			virtual int connect(const ServiceUrl & peerUrl , const ServiceUrl &localUrl )
			{
				return m_udpConnector.connect(localUrl.port,localUrl.host);
			}

			virtual int disconnect()
			{
				m_udpConnector.disconnect();		
				return 0; 
			} 

		private:

			UdpConnectorImpl m_udpConnector; 
		};

	}
}
#endif //

